//
//  DetailKindNavigateCollectionCell.m
//  MarianasTrench
//
//  Created by 王晓晨 on 16/3/18.
//  Copyright © 2016年 王爵. All rights reserved.
//

#import "DetailKindNavigateCollectionCell.h"

@implementation DetailKindNavigateCollectionCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubViews];
        
    }return self;
}

- (void)setMoreDetailKindModel:(MoreDetailKindModel *)moreDetailKindModel {
    if (_moreDetailKindModel != moreDetailKindModel) {
        _moreDetailKindModel = moreDetailKindModel;
    }
    self.titleLabel.text = moreDetailKindModel.tname;
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.font = [UIFont systemFontOfSize:16];
}

- (void)createSubViews {
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLabel];
    
    self.colorView = [[UIView alloc] init];
    [self.contentView addSubview:_colorView];
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    _titleLabel.frame = CGRectMake(0, 5, CELLWIDTH, CELLHEIGHT - 10);
    
    _colorView.frame = CGRectMake(0, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 3, CELLWIDTH, 2);
}

@end
